Repository navigation
fix(id): validate find/search --format values (CLI value_parser + REPL) — #2773 - #3492
Merged
Merged
Conversation
…L) and correct find.rs default doc Closes the silent-typo hole in #2773: --format was a bare String on both the CLI and the REPL path, so gorup/yaml/GROUP/empty rendered the tag format with exit 0 via the printers fallthrough arm. - cli.rs: value_parser = [tag, group, union] on Find and Search --format; invalid values now fail at clap parse time naming the accepted values. - repl/runner.rs: parse_find_args records format_error for an unknown --format value (never stored as the format); find/search/show handlers surface the error before any printing. - commands/find.rs: module doc now names tag as the default format. - Tests: CLI try_parse rejection/acceptance for both commands; REPL parse tests for invalid and valid --format values.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the pinned fix for #2773 (triage task 4008, CONFIRMED at main
df3b63d1f):id find/id search --formatwas a bareStringwith no validation, so any typo (gorup,yaml,GROUP, empty) silently rendered the tag format with exit 0 via the printers' fallthrough arm.value_parser = ["tag", "group", "union"]on the--formatarg of both Find (~890) and Search (~957), matching the file's existingvalue_parserlist pattern (e.g. role at :1412). Invalid values now fail at clap parse time naming the accepted values.parse_find_argsvalidates the--formatvalue: an unknown value is recorded asFindArgs.format_errorand is never stored as the format; the find/search/show handlers surfaceerror: invalid --format "...": expected tag, group, or unionbefore any printing, so an unknown value cannot reach the printers.Printers' fallthrough arms in helpers.rs are unchanged (packet scope): with both entry points validated, unknown values are unreachable.
Tests
test_cli_parse_find_with_format:Cli::try_parse_fromrejectsgorup/yaml/GROUP/""and acceptstag/group/unionfor BOTH find and search.--formatyieldsformat_errorand leaves the default format stored; valid values are stored with no error.cargo test test_cli_parse,cargo test test_parse_find_args) executing on the laptop against this branch; full pkgs/id suite runs in CI per repo workflow.Queue task 5445 · Issue #2773
Need help on this PR? Tag
@codesmith-botwith what you need.